StringBuilder a1 = new StringBuilder();
        for (int i = 0; i < a.length(); i++) {
            if(a.charAt(i) == ' '){
                a1.append("%20");
            } else {
                a1.append(a.charAt(i));
            }
        }
        System.out.println(a1.toString());